package com.nj.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@TableName("b_product_info")
public class Product {
   @TableId(type = IdType.AUTO)
    private Integer id;
   @TableField(value = "product_name")
    private String productName;
    private BigDecimal rate;
    private Integer cycle;//周期：单位是月
    @TableField(value = "release_time")
    private LocalDate releaseTime;
    @TableField(value = "product_type")
    private Integer productType;//产品类型 0新手宝，1优选产品，2散标产品
    @TableField(value = "product_no")
    private String productNo;
    @TableField(value = "product_money")
    private BigDecimal productMoney;
    @TableField(value = "left_product_money")
    private BigDecimal leftProductMoney;
    @TableField(value = "bid_min_limit")//最低起投
    private BigDecimal bidMinLimit;
    @TableField(value = "bid_max_limit")
    private BigDecimal bidMaxLimit;
    @TableField("product_status")
    private Integer productStatus;
    @TableField("product_full_time")
    @JsonSerialize(using = LocalDateTimeSerializer.class)//序列化器
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)//反序列化器
    private LocalDateTime productFullTime;
    @TableField("product_desc")
    private String productDesc;

}
